Skip to content

fix: windows script#40

Merged
saadqbal merged 3 commits into
mainfrom
develop
Mar 9, 2026
Merged

fix: windows script#40
saadqbal merged 3 commits into
mainfrom
develop

Conversation

@saadqbal
Copy link
Copy Markdown
Contributor

@saadqbal saadqbal commented Mar 9, 2026

Note

Medium Risk
Touches the Windows installer flow for WSL, GPU setup, cluster creation, and Helm install; the new timeouts and process/job handling could change behavior on slower machines or leave steps skipped, affecting install reliability.

Overview
Improves Windows installation robustness by adding explicit timeouts around WSL operations (update, default-version set, distro listing) and NVIDIA Container Toolkit setup, with clearer warnings/hints when steps are skipped or require manual follow-up.

Reworks k3d cluster create execution to run via Start-Process with a progress spinner and captured stdout/stderr logging, applies a post-merge kubeconfig rewrite from host.docker.internal to 127.0.0.1, and logs Helm install output (including it in failure messages). The bootstrap install.ps1 now invokes the downloaded script via powershell.exe -ExecutionPolicy Bypass for more consistent execution.

Written by Cursor Bugbot for commit 80e6685. This will update automatically on new commits. Configure here.

saadqbal added 2 commits March 9, 2026 14:33
…l-k8s.ps1

- Added functionality to update the kubeconfig file, replacing 'host.docker.internal' with '127.0.0.1' if the file exists, ensuring proper connectivity.
- Captured and logged Helm output during installation for better visibility and troubleshooting, enhancing user experience during the installation process.
- Changed the command to execute the script using 'powershell.exe -ExecutionPolicy Bypass -File' to ensure proper execution policy handling.
- This modification enhances the security and reliability of script execution during the installation process.
Comment thread scripts/install.ps1

try {
& $ScriptDest @args
powershell.exe -ExecutionPolicy Bypass -File $ScriptDest @args
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Child process exit code not propagated to parent

High Severity

Switching from & $ScriptDest @args (same-session) to powershell.exe -ExecutionPolicy Bypass -File $ScriptDest @args (child process) means the installer's exit code is no longer propagated. The install-k8s.ps1 script uses exit 1 and exit 2 for various failure paths (including the Err function), but after the child powershell.exe terminates, $LASTEXITCODE is never checked or forwarded. The parent always exits with code 0, silently masking installation failures.

Fix in Cursor Fix in Web

- Implemented timeout handling for WSL update and setting default version, improving script robustness.
- Added job management for WSL commands to prevent hanging processes and provide user feedback on potential issues.
- Improved logging and hints for manual intervention when WSL commands fail or time out, enhancing user experience during installation.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread scripts/install-k8s.ps1
Stop-Job $wslSetJob; Remove-Job $wslSetJob -Force
Warn "Could not set WSL2 as default."
Hint "Try running 'wsl --update' manually, then re-run this script."
Hint "Try running 'wsl --set-default-version 2' manually."
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WSL set-default-version success check ignores command exit code

Medium Severity

The old code verified wsl --set-default-version 2 succeeded by checking $LASTEXITCODE -eq 0. The new code only checks whether the background job completed within the timeout via Wait-Job, but Wait-Job returns the job object regardless of whether the command inside exited with a non-zero code — the job state is "Completed" either way. So if the WSL command fails, the script still logs "WSL2 set as default." and the user never sees the warning or the hint to run it manually.

Fix in Cursor Fix in Web

@saadqbal saadqbal merged commit bd1a4e7 into main Mar 9, 2026
1 check passed
@saadqbal saadqbal self-assigned this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant